#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main(){
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        int x;
        cin >> x;
        a[x] = 1;
    }
    int cnt = 0;
    for (int i = 1; i <= 1000; i++){
        if (a[i] == 1) cnt++;
    }
    cout << cnt << endl;
    for (int i = 1; i < 1000; i++){
        if (a[i] == 1) cout << i << " ";
    }
    return 0;
}